#ifndef __CONDITION_H
#define __CONDITION_H

#include "SDL/SDL.h"

class mutex;

/**
 * Une condition comme chez POSIX le gaulois
 */
class condition {
	SDL_cond *ma_condition_;
public:
	condition() throw() : ma_condition_(SDL_CreateCond()) {}
	void attendre(mutex &m) { SDL_CondWait(ma_condition_, m.mon_mutex_); }
	void provoquer() { SDL_CondSignal(ma_condition_); }
	~condition() throw() { SDL_DestroyCond(ma_condition_); }
};

#endif
